home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 26.zip / BS1 part 26 / Aztec C v5.2a disk 4.adf / 204inc_h.lzh / intuition / cghooks.h next >
C/C++ Source or Header  |  1991-03-14  |  2KB  |  82 lines

  1. #ifndef INTUITION_CGHOOKS_H
  2. #define INTUITION_CGHOOKS_H 1
  3. /*
  4. **  $Filename: intuition/cghooks.h $
  5. **  $Release: 2.04 $
  6. **  $Revision: 36.1 $
  7. **  $Date: 90/11/01 $
  8. **
  9. **  Custom Gadget processing
  10. **
  11. **  (C) Copyright 1985,1986,1987,1988,1989,1990 Commodore-Amiga, Inc.
  12. **        All Rights Reserved
  13. */
  14.  
  15. #ifndef EXEC_TYPES_H
  16. #include <exec/types.h>
  17. #endif
  18.  
  19. #ifndef INTUITION_INTUITION_H
  20. #include <intuition/intuition.h>
  21. #endif
  22.  
  23. /*
  24.  * Package of information passed to custom and 'boopsi'
  25.  * gadget "hook" functions.  This structure is READ ONLY.
  26.  */
  27. struct GadgetInfo {
  28.  
  29.     struct Screen        *gi_Screen;
  30.     struct Window        *gi_Window;    /* null for screen gadgets */
  31.     struct Requester        *gi_Requester;    /* null if not GTYP_REQGADGET */
  32.  
  33.     /* rendering information:
  34.      * don't use these without cloning/locking.
  35.      * Official way is to call ObtainRPort()
  36.      */
  37.     struct RastPort        *gi_RastPort;
  38.     struct Layer        *gi_Layer;
  39.  
  40.     /* copy of dimensions of screen/window/g00/req(/group)
  41.      * that gadget resides in.    Left/Top of this box is
  42.      * offset from window mouse coordinates to gadget coordinates
  43.      *        screen gadgets:            0,0 (from screen coords)
  44.      *    window gadgets (no g00):    0,0
  45.      *    GTYP_GZZGADGETs (borderlayer):        0,0
  46.      *    GZZ innerlayer gadget:        borderleft, bordertop
  47.      *    Requester gadgets:        reqleft, reqtop
  48.      */
  49.     struct IBox            gi_Domain;
  50.  
  51.     /* these are the pens for the window or screen    */
  52.     struct {
  53.     UBYTE    DetailPen;
  54.     UBYTE    BlockPen;
  55.     }                gi_Pens;
  56.  
  57.     /* the Detail and Block pens in gi_DrInfo->dri_Pens[] are
  58.      * for the screen.    Use the above for window-sensitive
  59.      * colors.
  60.      */
  61.     struct DrawInfo        *gi_DrInfo;
  62.  
  63.     /* reserved space: this structure is extensible
  64.      * anyway, but using these saves some recompilation
  65.      */
  66.     ULONG            gi_Reserved[6];
  67. };
  68.  
  69. /*** system private data structure for now ***/
  70. /* prop gadget extra info    */
  71. struct PGX    {
  72.     struct IBox    pgx_Container;
  73.     struct IBox    pgx_NewKnob;
  74. };
  75.  
  76. /* this casts MutualExclude for easy assignment of a hook
  77.  * pointer to the unused MutualExclude field of a custom gadget
  78.  */
  79. #define CUSTOM_HOOK( gadget ) ( (struct Hook *) (gadget)->MutualExclude)
  80.  
  81. #endif
  82.